<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据模版定义规范 - Array</title>
</head>

<body>
    <script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.1-beta3/mock-min.js"></script>
    <h2>F12打开控制台查看数据，效果更佳</h2>
    <div class="box">
        展示内容:<div id="content"></div>
    </div>
    <script>

        //生成数据
        list = Mock.mock({
            "从属性值 `array` 中随机选取 1 个元素，作为最终值。|1": [
                "AMD",
                "CMD",
                "UMD"
            ],
            "从属性值 `array` 中顺序选取 1 个元素，作为最终值。|+1": [
                "AMD",
                "CMD",
                "UMD"
            ],
            "通过重复属性值 array 生成一个新数组，重复次数大于等于 `1`，小于等于 `3`|1-3": [
                {
                    "顺序选取|+1": [
                        "Hello",
                        "Mock.js",
                        "!"
                    ]
                }
            ],
            "通过重复属性值 array 生成一个新数组，重复次数大于等于 `1`，小于等于 `3`。|1-3": [
                "Hello",
                "Mock.js",
                "!"
            ],
            "通过重复属性值 `array` 生成一个新数组，重复次数为 `2`次。|2": [
                "Hello",
                "Mock.js",
                "!"
            ]
        })

        //展示数据
        console.table(list)
        x = document.getElementById("content");
        //将对象转为JSON
        x.innerHTML = JSON.stringify(list, null, '<br />');
    </script>

</body>

</html>